package com.bestcem.xm.txtanls.grpc.service.param.topic;


import com.bestcem.xm.common.core.constant.RegTypes;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import static com.bestcem.xm.common.core.constant.Constants.TWENTY;

/**
 * @author liheng
 * @version v1.0
 * @date 2021/5/20 10:47
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CreateTopicParam {

    /**
     * 话题类型
     *
     * @see com.bestcem.xm.txtanls.grpc.v1.enums.TopicTypeEnum
     */
    @NotNull(message = "话题类型不能为空")
    @JsonProperty(value = "ttype")
    private Integer type;

    /**
     * 名称
     */
    @NotBlank(message = "名称不能为空")
    @Size(max = TWENTY, message = "名称长度不能超过20")
    @JsonProperty(value = "name")
    private String name;

    /**
     * 文本分析项目id
     */
    @NotBlank(message = "分析项目id不能为空")
    @Pattern(regexp = RegTypes.OBJECT_ID, message = "项目id格式错误")
    @JsonProperty(value = "anlsprojectID")
    private String projectId;

    /**
     * 话题组id
     */
    @JsonProperty(value = "topicgID")
    private String topicGId;

}
